import MySQLdb

conn = MySQLdb.Connection(host='localhost', db='ks', user='root', passwd='root')

def get_cursor():
    return conn.cursor()